#ifndef __RYE_BLOCK_H__
#define __RYE_BLOCK_H__

#include "Block.hpp"

namespace PocketSurvival
{
    // 黑麦
    class RyeBlock : public Block
    {
    public:
        static constexpr int32_t Index()
        {
            return 174;
        }
        virtual int32_t getIndex() override; 
        virtual const std::string &getBlockName() override;

        virtual void getCreativeValues(std::vector<int32_t> &blockVec) override;
        virtual void getDropValues(int32_t oldValue, int32_t newValue, int32_t toolLevel, std::vector<BlockDropValue> &dropValues) override;
    
        virtual const std::vector<BoundingBox> &getCustomCollisionBoxes(int32_t value) override;

	    static inline int32_t GetSize(int32_t data);
	    static inline int32_t SetSize(int32_t data, int32_t size);
	    static inline bool GetIsWild(int32_t data);
	    static inline int32_t SetIsWild(int32_t data, bool isWild);
    };

	inline int32_t RyeBlock::GetSize(int32_t data)
	{
		return data & 7;
	}
	inline int32_t RyeBlock::SetSize(int32_t data, int32_t size)
	{
		size = MathUtils::Clamp<int32_t>(size, 0, 7);
		return (data & -8) | (size & 7);
	}
	inline bool RyeBlock::GetIsWild(int32_t data)
	{
		return (data & 8) != 0;
	}
	inline int32_t RyeBlock::SetIsWild(int32_t data, bool isWild)
	{
		if (!isWild)
		{
			return data & -9;
		}
		return data | 8;
	}

} // namespace PocketSurvival


#endif
